﻿@model Dal.Entities.User
@{
    Layout = null;
    ViewBag.Nav = 5;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>更改用户密码</title>
    @Html.Partial("meta")
</head>
<body id="b_main">
    @Html.Partial("header")
    <!--/end #header-->
    <div id="wrapper">
        <!--holds pretty much everything-->
        @Html.Action("index", "news")
        <!--/end #menu_main-->
        <div id="content">
            @Html.Partial("nav")
            @using (Html.BeginForm("changepassword", "account", FormMethod.Post, new { @class = "broom_form", id = "form1", style = "margin-left: 30px;" }))
            {
                <!--/form acts as separator - stroke on top-->
                @Html.Partial("ResultMsg")
                <table cellspacing="0" summary="table" class="broom_table" width="90%">
                    <thead>
                        <tr class="odd">
                            <td colspan="2" style="font-size: 14px; font-weight: bold">
                                修改密码
                            </td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="even">
                            <td>
                                旧密码: <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.Password("passwordold", null, new { @class = "inputbox" })
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                新密码: <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.Password("passwordnew", null, new { @class = "inputbox" })
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                确认密码: <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.Password("passwordconfirm", null, new { @class = "inputbox" })
                            </td>
                        </tr>
                    </tbody>
                </table>
                @Html.HiddenFor(i => i.ID);
                <div class="button">
                    <div class="btn-inner">
                        <span><em>
                            <button type="submit">
                                <img src="/assets/img/icons/disk_black.png" alt="" />保存数据</button>
                        </em></span>
                    </div>
                </div>
            }
        </div>
    </div>
    <div class="clear">
        <script type="text/javascript">
            $(document).ready(function () {
                $("#form1").validate({
                    rules: {
                        passwordold: { required: true },
                        passwordnew: { required: true, minlength: 4 },
                        passwordconfirm: { required: true, equalTo: "#passwordnew" }
                    },
                    messages: {
                        passwordold: { required: "旧密码不能为空" },
                        passwordnew: { required: "新密码不能为空", minlength: "密码最低要求4位" },
                        passwordconfirm: { required: "请再次输入新输入密码", equalTo: "两次密码不匹配" }
                    }
                });
            });
        </script>
    </div>
</body>
</html>
